import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  mode: "hash", //带#，开发环境无误，打包后页面会出问题
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "默认路径",
      redirect: "/login",
    },
    {
      path: "/login",
      name: "登录",
      component: () => import('@/views/Login.vue'),
    },
    {
      path: "/main",
      name: "主窗口",
      redirect: "/chat",
      component: () => import('@/views/Main.vue'),
      children:[{
        path:"/chat",
        name:"聊天",
        component:()=>import('@/views/chat/Chat.vue')
      }]
    }
  ]
})
export default router
